package com.example.nonameaa.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.nonameaa.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.nonameaa.service.UserService;
import org.apache.ibatis.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * <p>
 * 用户表 Mapper 接口
 * </p>
 *
 * @author NoName
 * @since 2024-09-24
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from `user` where username= #{username}")
    User selectByUsername(String username);

    @Update("UPDATE `user` SET token = #{tokena} WHERE id = #{tokenID}")
    void insertToken(@Param("tokenID") Integer tokenID, @Param("tokena")String tokena);









  /*  @Insert("insert into `user` (username,passward,name,phone,email,address,avator,role)" +
            " values (#{username},#{passward},#{name},#{phone},#{email},#{address},#{avator},#{role})")
    void insert(User user);*/



}
